package actions.members;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import veilingDomein.User;
import veilingService.DBController;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class UpdateForm extends ActionSupport implements SessionAware {

	private User user;
	private String naam;
	private String adres;
	private String woonplaats;
	private String username;
	private String password;
	private String email;
	private String passwordRepeat;
	private String emailRepeat;
	
	@SuppressWarnings("rawtypes")
	private Map session;
	DBController db = new DBController();

	public String execute() {
		session = ActionContext.getContext().getSession();
		return SUCCESS;
	}

	public void validate() {
		
		if (session.containsKey("user")) {
			user = (User) session.get("user");
			username = user.getUsername();
			password = user.getPassword();
		}
	}

	public User getUser() {
		return user;
	}

	@SuppressWarnings("rawtypes")
	public void setSession(Map session) {
		this.session = session;
	}

	@SuppressWarnings("rawtypes")
	public Map getSession() {
		return session;
	}

}
